#include <iostream>
#include "Router.h"

std::unordered_map<std::string, std::function<int(json)>> Router::routerMap = {
        {"Test", Router::Test}
};

int Router::Call(const std::string &method, const json &request)
{
    if (routerMap.find(method) == routerMap.end()) {
        return -1;
    }
    return routerMap[method](request);
}

int Router::Test(const json &request)
{
    std::cout << "Test" << std::endl;
    return 0;
}

int Router::Update(const json &request)
{
    return 0;
}